
#ifndef ESTATS_MIB_VAR_H
#define ESTATS_MIB_VAR_H
/*
enum MIB_TABLE {
        PERF_TABLE,
        PATH_TABLE,
        STACK_TABLE,
        APP_TABLE,
        TUNE_TABLE,
        __MAX_TABLE
};
#define MAX_TABLE __MAX_TABLE
*/
extern int max_index[];

static inline int single_index(int inda, int indb)
{
	int ret = indb;
	int i;

	if (inda > 0) {
		for (i = 0; i < inda; i++) {
			ret += max_index[i];
		}
	}
	return ret;
}

typedef enum ESTATS_PERF_INDEX {
	SEGSOUT                 = 0,
	DATASEGSOUT,
	DATAOCTETSOUT,
	HCDATAOCTETSOUT, 
	SEGSRETRANS,
	OCTETSRETRANS,
	SEGSIN,
	DATASEGSIN,
	DATAOCTETSIN,
	HCDATAOCTETSIN, 
	ELAPSEDSECS,
	ELAPSEDMICROSECS,
	STARTTIMESTAMP,
	CURMSS,
	PIPESIZE,
	MAXPIPESIZE,
	SMOOTHEDRTT,
	CURRTO,
	CONGSIGNALS,
	CURCWND,
	CURSSTHRESH,
	TIMEOUTS,
	CURRWINSENT,
	MAXRWINSENT,
	ZERORWINSENT,
	CURRWINRCVD,
	MAXRWINRCVD,
	ZERORWINRCVD,
	SNDLIMTRANSRWIN,
	SNDLIMTRANSCWND,
	SNDLIMTRANSSND,
	SNDLIMTRANSTSODEFER,
	SNDLIMTIMERWIN,
	SNDLIMTIMECWND,
	SNDLIMTIMESND,
	SNDLIMTIMETSODEFER,
        __PERF_INDEX_MAX
} ESTATS_PERF_INDEX;
#define PERF_INDEX_MAX __PERF_INDEX_MAX

typedef enum ESTATS_PATH_INDEX {
        RETRANTHRESH,
        NONRECOVDAEPISODES,
        SUMOCTETSREORDERED,
        NONRECOVDA,
        SAMPLERTT,
        RTTVAR,
        MAXRTT,
        MINRTT,
        SUMRTT,
        HCSUMRTT,
        COUNTRTT,
        MAXRTO,
        MINRTO,
        IPTTL,
        IPTOSIN,
        IPTOSOUT,
        PRECONGSUMCWND,
        PRECONGSUMRTT,
        POSTCONGSUMRTT,
        POSTCONGCOUNTRTT,
        ECNSIGNALS,
        DUPACKEPISODES,
        RCVRTT,
        DUPACKSOUT,
        CERCVD,
        ECESENT,
        __PATH_INDEX_MAX
} ESTATS_PATH_INDEX;
#define PATH_INDEX_MAX __PATH_INDEX_MAX

typedef enum ESTATS_STACK_INDEX {
	ACTIVEOPEN,
	MSSSENT,
	MSSRCVD,
	WINSCALESENT,
	WINSCALERCVD,
	TIMESTAMPS,
	ECN,
	WILLSENDSACK,
	WILLUSESACK,
	STATE,
	NAGLE,
	MAXSSCWND,
	MAXCACWND,
	MAXSSTHRESH,
	MINSSTHRESH,
	INRECOVERY,
	DUPACKSIN,
	SPURIOUSFRDETECTED,
	SPURIOUSRTODETECTED,
	SOFTERRORS,
	SOFTERRORREASON,
	SLOWSTART,
	CONGAVOID,
	OTHERREDUCTIONS,
	CONGOVERCOUNT,
	FASTRETRAN,
	SUBSEQUENTTIMEOUTS,
	CURTIMEOUTCOUNT,
	ABRUPTTIMEOUTS,
	SACKSRCVD,
	SACKBLOCKSRCVD,
	SENDSTALL,
	DSACKDUPS,
	MAXMSS,
	MINMSS,
	SNDINITIAL,
	RECINITIAL,
	CURRETXQUEUE,
	MAXRETXQUEUE,
	CURREASMQUEUE,
	MAXREASMQUEUE,
	EARLYRETRANS,
	EARLYRETRANSDELAY,
        __STACK_INDEX_MAX
} ESTATS_STACK_INDEX;
#define STACK_INDEX_MAX __STACK_INDEX_MAX

typedef enum ESTATS_APP_INDEX {
        SNDUNA,
        SNDNXT,
        SNDMAX,
        THRUOCTETSACKED,
        HCTHRUOCTETSACKED, 
        RCVNXT,
        THRUOCTETSRECEIVED,
        HCTHRUOCTETSRECEIVED, 
        CURAPPWQUEUE,
        MAXAPPWQUEUE,
        CURAPPRQUEUE,
        MAXAPPRQUEUE,
        __APP_INDEX_MAX
} ESTATS_APP_INDEX;
#define APP_INDEX_MAX __APP_INDEX_MAX

typedef enum ESTATS_TUNE_INDEX { 
        LIMCWND,
        LIMSSTHRESH,
        LIMRWIN,
        LIMMSS,
        __TUNE_INDEX_MAX
} ESTATS_TUNE_INDEX;
#define TUNE_INDEX_MAX __TUNE_INDEX_MAX

#define TOTAL_INDEX_MAX PERF_INDEX_MAX+PATH_INDEX_MAX+STACK_INDEX_MAX+APP_INDEX_MAX+TUNE_INDEX_MAX

#if BITS_PER_LONG == 64
#define DEFAULT_PERF_MASK	(1UL << PERF_INDEX_MAX)-1
#define DEFAULT_PATH_MASK	(1UL << PATH_INDEX_MAX)-1
#define DEFAULT_STACK_MASK	(1UL << STACK_INDEX_MAX)-1
#define DEFAULT_APP_MASK	(1UL << APP_INDEX_MAX)-1
#define DEFAULT_TUNE_MASK	(1UL << TUNE_INDEX_MAX)-1
#define DEFAULT_EXTRAS_MASK	(1UL << EXTRAS_INDEX_MAX)-1
#else
#define DEFAULT_PERF_MASK	(1ULL << PERF_INDEX_MAX)-1
#define DEFAULT_PATH_MASK	(1ULL << PATH_INDEX_MAX)-1
#define DEFAULT_STACK_MASK	(1ULL << STACK_INDEX_MAX)-1
#define DEFAULT_APP_MASK	(1ULL << APP_INDEX_MAX)-1
#define DEFAULT_TUNE_MASK	(1ULL << TUNE_INDEX_MAX)-1
#define DEFAULT_EXTRAS_MASK	(1ULL << EXTRAS_INDEX_MAX)-1
#endif

#endif /* ESTATS_MIB_VAR_H */
